<template>
  <div class="studengtProfill">
    <!-- 头像 -->
    <div class="stuImg">
          <el-avatar shape="square" :size="150"  :src="stuProfile.headimgurl" ></el-avatar>
        </div>
    <el-descriptions
      class="margin-top"
      :column="3"
      :size="size"
      border
    >
      <!-- <template slot="extra">
        <el-button type="primary" size="small">操作</el-button>
      </template> -->
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-user"></i>
          姓名
        </template>
        {{stuProfile.name}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-mobile-phone"></i>
          年龄
        </template>
        {{stuProfile.age}}
      </el-descriptions-item>
            <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-location-outline"></i>
          班级
        </template>
        {{stuProfile.class}}
      </el-descriptions-item>
            <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-location-outline"></i>
          学历
        </template>
        {{stuProfile.degree}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-location-outline"></i>
          城市
        </template>
        {{stuProfile.city}}
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-tickets"></i>
          描述信息
        </template>
        <el-tag size="small">{{stuProfile.description}}</el-tag>
      </el-descriptions-item>
      <el-descriptions-item>
        <template slot="label">
          <i class="el-icon-office-building"></i>
          创建时间
        </template>
        {{stuProfile.cTime}}
      </el-descriptions-item>
    </el-descriptions>
  </div>
</template>

<script>
// import {mapState} from 'vuex'
// router.go(0)
export default {
   data () {
      return {
        size: '80',
        stuProfile:{}
      };
    },
    created(){
      this.stuProfile = JSON.parse(localStorage.getItem('stuProfile'))
      // console.log(this.stuProfile);
    },
    watch: {
      "this.$store.state.stuProfile"(){
        this.stuProfile = this.$store.getters.stuProfile
      }
    }
};
</script>

<style scoped>
.stuImg{
  padding-top: 20px;
  text-align: left;
}
</style>
